//
//  HNHappyFamilyViewController.m
//  XDEducation
//
//  Created by 星道 on 17/5/24.
//  Copyright © 2017年 apple. All rights reserved.
//

#import "HNHappyFamilyViewController.h"
#import "HNFamilyMobilizeController.h"
#import "HNHappyWishController.h"
#import "HNAutoGenerationController.h"
#import "HNVMainuUserListiController.h"
#import "HNTimeBoxController.h"
#import "HNCreditGoidPushFunction.h"
#import "HNHappyFamilyMusicWorldController.h"
#import "HNHappyFamilyTVController.h"
#import "HNHappyFamilyWebController.h"
#import "HNHappyFamilyJJGameController.h"
#import "HNHNHappyFamilyAboutMeSelectController.h"
#import "HNHappyTimeController.h"
@interface HNHappyFamilyViewController ()
{
    IBOutletCollection(UIView) NSArray *_TopViews;
}
@end

@implementation HNHappyFamilyViewController


- (void)viewDidLoad
{
    [super viewDidLoad];
    
    for (int i=0; i<_TopViews.count; i++)
    {
        UITapGestureRecognizer *Tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(ClickTopViewWithTap:)];
        UIView *View = _TopViews[i];
        [View addGestureRecognizer:Tap];
        UIView *TapView = [Tap view];
        TapView.tag = 1200+i;
    }
}


#pragma mark - Function
/** 上方的八个功能 */
- (void)ClickTopViewWithTap:(UIGestureRecognizer *)Tap
{
    //1200全家 1201快乐 1202动态 1203家风 1204美好 1205诚信 1206时光 1207关于
    UIView *View = [Tap view];
    if (View.tag == 1200)
    {
        HNFamilyMobilizeController *VC = [[HNFamilyMobilizeController alloc] init];
        VC.title = @"全家总动员";
        [self.navigationController pushViewController:VC animated:YES];
    }
    else if (View.tag == 1201)
    {
        HNHappyWishController *VC = [[HNHappyWishController alloc] init];
        VC.title = @"快乐约定";
        [self.navigationController pushViewController:VC animated:YES];
    }
    else if (View.tag == 1202)
    {
        HNAutoGenerationController *VC = [[HNAutoGenerationController alloc] init];
        VC.title = @"三好动态评价";
        [self.navigationController pushViewController:VC animated:YES];
    }
    else if (View.tag == 1203)
    {
        HNVMainuUserListiController *VC = [[HNVMainuUserListiController alloc] init];
        VC.title = @"家风家规";
        [self.navigationController pushViewController:VC animated:YES];
    }
    else if (View.tag == 1204)
    {
        HNHappyTimeController *VC = [[HNHappyTimeController alloc] init];
        VC.title = @"美好时光";
        [self.navigationController pushViewController:VC animated:YES];
    }
    else if (View.tag == 1205)
    {
        //诚信是金
        HNCreditGoidPushFunction *xx = [[HNCreditGoidPushFunction alloc] initWithViewController:self];
    }
    else if (View.tag == 1206)
    {
        HNTimeBoxController *VC = [[HNTimeBoxController alloc] init];
        VC.title = @"时光宝盒";
        [self.navigationController pushViewController:VC animated:YES];
    }
    else if (View.tag == 1207)
    {
        HNHNHappyFamilyAboutMeSelectController *VC = [[HNHNHappyFamilyAboutMeSelectController alloc] init];
        [self.navigationController pushViewController:VC animated:YES];
    }
    else
    {
    }
}










#pragma mark - Action
/** 下方的四方功能 */
- (IBAction)ClickBottonButton:(UIButton *)sender
{
    //1100小游戏 1101浏览器 1102星影分享 1103音乐世界
    if (sender.tag == 1103)
    {
        HNHappyFamilyMusicWorldController *VC = [[HNHappyFamilyMusicWorldController alloc] init];
        [self.navigationController pushViewController:VC animated:YES];
    }
    else if (sender.tag == 1102)
    {
        HNHappyFamilyTVController *VC = [[HNHappyFamilyTVController alloc] init];
        [self.navigationController pushViewController:VC animated:YES];
    }
    else if (sender.tag == 1101)
    {
        HNHappyFamilyWebController *VC = [[HNHappyFamilyWebController alloc] init];
        [self.navigationController pushViewController:VC animated:YES];
    }
    else if (sender.tag == 1100)
    {
        HNHappyFamilyJJGameController *VC = [[HNHappyFamilyJJGameController alloc] init];
        [self.navigationController pushViewController:VC animated:YES];
    }
    else
    {
    }
}

@end
